"""
对一个匪徒 警察是子弹伤害为10
恐怖分子子弹伤害是5  枪枪命中
反恐精英： 警察 和  恐怖分子  血量都是100    模拟开枪
"""



class Fetu:
    def __init__(self, name, life=100):
        self.name = name
        self.life = life

    def f_shang_hai(self, people):  #people---->警察这个对象
        people.life -= 5  #警察每次掉5滴血

class Police:
    def __init__(self,name,life=100):
        self.name=name
        self.life= life

    def  p_shang_hai(self,people):
        people.life-=10

f1=Fetu("匪徒")

p1=Police("警察")
p1.p_shang_hai(f1)

# 我们自定义的类,也可以当成参数来传递
class People:
    def __init__(self, name, life=100):
        self.name = name
        self.life = life
    def shang_hai(self, people,value):
        people.life -= value
        print(f"{people.name}剩余血量{people.life}")
